package edu.wit.common.api;

import edu.wit.common.api.factory.RemoteUserinfoFallbackFactory;
import edu.wit.common.api.model.LoginUser;
import edu.wit.common.core.domain.R;
import edu.wit.common.enums.BusinessType;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(contextId = "remoteUserinfoService", value = "service-acl", fallbackFactory = RemoteUserinfoFallbackFactory.class)
public interface RemoteUserinfoService {

    /**
     * 根据用户名查用户id
     * @return
     */
    @GetMapping("/admin/acl/user/getIdByUsername/{username}")
    Long getIdByUsername(@PathVariable String username);

    @GetMapping("/admin/acl/user/info/{username}")
    public R<LoginUser> getUserInfo(@PathVariable String username);

    @PutMapping("/admin/acl/user/updateLoginIp")
    public void updateLoginIp(@RequestBody LoginUser loginUser);
}
